<template>
  <view class="min-h-[100vh] !bg-[var(--page-bg-color)]" :style="themeColor()" v-if="memberStore.info">
    <view class="fixed w-full z-2  !bg-[#fff]">
      <view class="mt-[30rpx] bg-[#fff] tab-style-1">
        <view class="tab-left">
          <view class="tab-left-item !text-[32rpx]" :class="{ 'class-select': fromType === item.key }"
            @click="fromTypeFn(item.key, index)" v-for="(item, index) in accountTypeList">{{ item.name }}</view>
        </view>
        <view class="tab-right" @click="handleSelect">
          <view class="tab-right-date leading-[34rpx]">日期</view>
          <view class="nc-iconfont nc-icon-a-riliV6xx-36 tab-right-icon"></view>
        </view>
      </view>
    </view>
    <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="{ use: false }" height="auto"
      @up="getTradeTodayRebateSummaryFn" :top="'88rpx'">
      <view class="sidebar-margin  flex flex-wrap justify-between items-center">
        <!-- 实收业绩 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx]">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/f8f33900d5d57023de105dea615aa35b4121763383dc479a738279551197b80f.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">实收业绩(元)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                fen2yuan(todayRebate?.otherPrice?.currentValue || 0) }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              fen2yuan(todayRebate?.otherPrice?.yesterdayValue || 0) }}</view>

          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.otherPrice?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.otherPrice?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.otherPrice?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.otherPrice?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 划卡业绩 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx]">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/692be4e30572b7d4b9389bcabd3e1f41b5cee5b8700ea6f8d5d8507495a1b917.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">划卡业绩(元)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                fen2yuan(todayRebate?.ppcPrice?.currentValue || 0) }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              fen2yuan(todayRebate?.ppcPrice?.yesterdayValue || 0) }}</view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.ppcPrice?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.ppcPrice?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.ppcPrice?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.ppcPrice?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.ppcPrice?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.ppcPrice?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.ppcPrice?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.ppcPrice?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 消耗业绩 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/79548960d418f32a076911e44c7b14c7d1ac232e5f5753aa1029d597cd629a62.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">消耗业绩(元)</view>
              <view class="text-[#333] text-[44rpx] price-font  leading-[36rpx] mt-[12rpx]">{{
                fen2yuan(todayRebate?.performancePrice?.currentValue || 0) }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              fen2yuan(todayRebate?.performancePrice?.yesterdayValue || 0) }}</view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.performancePrice?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.performancePrice?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.performancePrice?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.performancePrice?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.performancePrice?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.performancePrice?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.performancePrice?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.performancePrice?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 欠款金额 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/3f82b384dcf82dfa852a7e826deadc421b8f7ca9fce81bf0028715f4297779ab.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">欠款金额(元)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                fen2yuan(todayRebate?.arrearsPrice?.currentValue || 0) }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              fen2yuan(todayRebate?.arrearsPrice?.yesterdayValue || 0) }}</view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.arrearsPrice?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.arrearsPrice?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.arrearsPrice?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.arrearsPrice?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.arrearsPrice?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.arrearsPrice?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.arrearsPrice?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.arrearsPrice?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 成交会员 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/d80c656401a7609b01d4b826e5685c411d5fbe28f0cc0201061bc441a5eb75fa.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">成交会员(人)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                todayRebate?.memberUser?.currentValue || 0 }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              todayRebate?.memberUser?.yesterdayValue || 0 }}</view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.memberUser?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.memberUser?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.memberUser?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.memberUser?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.memberUser?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.memberUser?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.memberUser?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.memberUser?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 服务项目 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/170af8949f9a0c743d889ca5d96bcc2e62c82ab898aff2b37548f27cbdc1a04c.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">服务项目(次)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                todayRebate?.serviceNum?.currentValue || 0 }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              todayRebate?.serviceNum?.yesterdayValue || 0 }}</view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.serviceNum?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.serviceNum?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.serviceNum?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.serviceNum?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.serviceNum?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.serviceNum?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.serviceNum?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.serviceNum?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 服务会员 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/d80c656401a7609b01d4b826e5685c411d5fbe28f0cc0201061bc441a5eb75fa.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">服务会员(人)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                todayRebate?.serviceUser?.currentValue || 0 }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              todayRebate?.serviceUser?.yesterdayValue || 0 }} </view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.serviceUser?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.otherPrice?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.serviceUser?.monthChain }}%<u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.otherPrice?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.otherPrice?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
        <!-- 新增会员 -->
        <view class="w-[49%]  flex flex-col items-center box-border card-template rounded-[8rpx] p-[10rpx] mt-[20rpx] ">
          <view class="flex items-center w-full border-0 border-b-[2rpx] border-solid border-[#ddd]">
            <view
              class="w-[80rpx] h-[80rpx] text-center rounded-[40rpx] text-[40rpx] font-500 leading-[80rpx] text-[#fff]">
              <u-image width="70rpx" height="70rpx"
                src="https://files.meton.vip/f5a543655a0039175b5797bac713cd2e68f7f0209a51b20db4763a0f734b436a.png"></u-image>
            </view>
            <view class="flex  w-full flex-col ml-[20rpx] text-right">
              <view class="text-[var(--text-color-light9)] text-[24rpx] ">新增会员(人)</view>
              <view class="text-[#333] text-[44rpx] price-font leading-[36rpx] mt-[12rpx]">{{
                todayRebate?.newUser?.currentValue || 0 }}</view>
            </view>
          </view>
          <view class="flex  w-full mt-[12rpx]">
            <view class="text-[var(--text-color-light9)] text-[24rpx] ">昨日:{{
              todayRebate?.newUser?.yesterdayValue || 0 }}

            </view>
          </view>
          <view class="flex  justify-between   w-full">
            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">日环比:{{
              todayRebate?.newUser?.dayChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.newUser?.dayTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.newUser?.dayTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.newUser?.dayTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

            <view class="text-[var(--text-color-light9)] text-[24rpx] mt-[12rpx] flex">月环比:{{
              todayRebate?.newUser?.monthChain }}% <u-image width="18rpx" height="18rpx"
                v-if="todayRebate?.newUser?.monthTrend == 0"
                src="https://files.meton.vip/df9f57ab912e1b9d6e987de8e43bfe405a750e8c9d26f1a8ef1364720bf97187.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.newUser?.monthTrend == 1"
                src="https://files.meton.vip/f7a04ff3ce0f702b93c2471ef8139d68597386285d5dfe77ea74f1d4ec3e03fa.png"></u-image>
              <u-image width="18rpx" height="18rpx" v-if="todayRebate?.newUser?.monthTrend == 2"
                src="https://files.meton.vip/81bc219f9faabe93676af7dafdb4ee8af8e0c0fdb5f3f50bbe74d70bb4ab4095.png"></u-image>
            </view>

          </view>
        </view>
      </view>

    </mescroll-body>
    <loading-page :loading="loading"></loading-page>
    <!-- 时间选择 -->
    <select-date ref="selectDateRef" @confirm="confirmFn" />
  </view>
  <!-- 水印 -->
  <watermark></watermark>
</template>

<script setup lang="ts">
import { ref, computed } from 'vue'
import { getTradeTodayRebateSummary } from '@/addon/statistics/api/statistics';
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
import { onShow, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
import useMemberStore from '@/stores/member'

import selectDate from '@/components/select-date/select-date.vue';
import { fen2yuan } from '@/utils/formatting';


const { mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
const memberStore = useMemberStore()






// 获取系统状态栏的高度
let menuButtonInfo: any = {};
// 如果是小程序，获取右上角胶囊的尺寸信息，避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API，尚未兼容)
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
// #endif




//获取数据来源类型
const accountTypeList = ref([
  { name: '今日', key: 0 },
  { name: '本周', key: 1 },
  { name: '本月', key: 2 },
])
const fromType = ref(0)
const create_time = ref([])
const todayRebate = ref<any>() //


//来源类型
const subActive = ref(0)
const fromTypeFn = (key: any, index: any) => {
  fromType.value = key
  subActive.value = index
  getMescroll().resetUpScroll();
}


const list = ref<Array<any>>([]),
  loading = ref<boolean>(true),
  listLoading = ref<boolean>(true),
  mescrollRef = ref(null);

interface mescrollStructure {
  num: number,
  size: number,
  endSuccess: Function,
  [propName: string]: any
}

const getTradeTodayRebateSummaryFn = (mescroll: mescrollStructure) => {
  listLoading.value = true;
  let data: Object = {

    query: fromType.value,
    times: create_time.value,


  };


  getTradeTodayRebateSummary(data).then((res: any) => {
    todayRebate.value = res.data

    listLoading.value = false;
    loading.value = false;
  }).catch(() => {
    listLoading.value = false;
    loading.value = false;
    mescroll.endErr(); // 请求失败, 结束加载
  })
}
//日期筛选
const selectDateRef = ref()
const handleSelect = () => {
  selectDateRef.value.show = true
}
// 确定时间筛选
const confirmFn = (data: any) => {
  create_time.value = data;
  list.value = []
  getMescroll().resetUpScroll();
}


</script>

<style lang="scss" scoped>
:deep(.uni-scroll-view) {
  overflow: auto hidden !important;
}

.body-bottom {
  padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
}

.pl-20rpx {
  padding-left: 20rpx;
}
</style>
